/*
 * Created on Sun Sep 17 2017
 * 
 * Copyright (c) 2017 jianglinjie
 */
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _FetchStrategy = require('./FetchStrategy');

var _FetchStrategy2 = _interopRequireDefault(_FetchStrategy);

var _NetStrategyType = require('./NetStrategyType');

var NetStrategyType = _interopRequireWildcard(_NetStrategyType);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var NetStrategyFactory = function () {
  function NetStrategyFactory() {
    _classCallCheck(this, NetStrategyFactory);
  }

  _createClass(NetStrategyFactory, null, [{
    key: 'createStrategy',
    value: function createStrategy(type) {
      switch (type) {
        case NetStrategyType.FETCH:
          return new _FetchStrategy2.default();
        default:
          return new _FetchStrategy2.default();
      }
    }
  }]);

  return NetStrategyFactory;
}();

exports.default = NetStrategyFactory;